//
//  YDYUIBarButtonItemManager.m
//  DYSisterAPP
//
//  Created by 杨德勇 on 16/7/26.
//  Copyright © 2016年 杨德勇. All rights reserved.
//

#import "YDYUIBarButtonItemManager.h"

@implementation YDYUIBarButtonItemManager
+(UIBarButtonItem *)ydy_itemWithImgName:(NSString *)imagename selectImgName:(NSString *)selectImgName target:(id)target action:(SEL)action{
    UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
    [btn setImage:[UIImage imageNamed:imagename] forState:UIControlStateNormal];
    [btn setImage:[UIImage imageNamed:selectImgName] forState:UIControlStateHighlighted];
    [btn addTarget:target action:action forControlEvents:UIControlEventTouchUpInside];
    [btn sizeToFit];
    
    return  [[UIBarButtonItem alloc]initWithCustomView:btn];
    
}

@end
